function *gen(){
  yield 1
  yield 2
  yield 3
}

const it = gen();

console.log(it.return()); //{ value: undefined, done: true }
//console.log(it.next()); //{ value: undefined, done: true }

//↓ return 可以调多次 不会报错
console.log(it.return('aaa')); //{ value: 'aaa', done: true }
